using Cfg.Builders;
using Cfg.ConfigProviders;
using NUnit.Framework;

namespace Cfg.Test
{
    [TestFixture]
    public class FinalizeStringValueTest
    {
        public class Config
        {
            public static string Root { get; set; }
            public static string ValueWithVariable { get; set; }
            public static string ValueWithVariableThatUsesVariable { get; set; }
        }

        [Test]
        public void FinalizeStringValue()
        {
            var c = new ConfigBuilder(typeof(Config), null, new DotnetConfigFileProvider(null));
            Assert.AreEqual(0, c.GetErrors().Length);

            Assert.AreEqual("/", Config.Root);
            Assert.AreEqual("/x/", Config.ValueWithVariable);
            Assert.AreEqual("/x/x/", Config.ValueWithVariableThatUsesVariable);
        }
    }
}